Skip to content

Conversation

@dkibui
Copy link

@dkibui dkibui commented Oct 19, 2025

This patch improves the spacing of highlighted method details in generated RDoc pages.

When a method anchor (for example, #method-i-force) is targeted, a left border is applied to the .method-detail element. Previously the border caused the inner content of the selected element to touch the left border, reducing readability.

This change adds a small left padding to the targeted element to maintain consistent spacing between the border and its contents.

Screenshot 2025-10-19 at 16 05 07 Screenshot 2025-10-19 at 16 04 43

@dkibui dkibui requested a deployment to fork-preview-protection October 19, 2025 21:43 — with GitHub Actions Waiting
@kou
Copy link
Member

kou commented Oct 29, 2025

If we use this approach, method entries aren't aligned:

image

How about this?

diff --git a/lib/rdoc/generator/template/darkfish/css/rdoc.css b/lib/rdoc/generator/template/darkfish/css/rdoc.css
index c84a604c..456d2a03 100644
--- a/lib/rdoc/generator/template/darkfish/css/rdoc.css
+++ b/lib/rdoc/generator/template/darkfish/css/rdoc.css
@@ -580,8 +580,9 @@ main .method-detail {
 }
 
 main .method-detail:target {
-  margin-left: -10px;
-  border-left: 10px solid var(--border-color);
+  margin-left: -15px;
+  border-left: 5px solid var(--border-color);
+  padding-left: 10px;
 }
 
 main .method-header {
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants